package redis

import (
	"gitee.com/injoyai/goutil/conv"
	"github.com/go-redis/redis/v7"
)

var Nil = redis.Nil

type Options = redis.Options

//New
//@addr,地址和端口 127.0.0.1:6379
//@pwd,密码
//@db,数据桶
func New(addr, pwd string, db ...int) *Client {
	data := &Client{Client: redis.NewClient(&Options{
		Addr:     addr,
		Password: pwd,
		DB:       conv.GetDefaultInt(0, db...),
	})}
	return data
}

func NewClient(op *Options) *Client {
	return &Client{
		Client: redis.NewClient(op),
	}
}
